package com.demon.net.json

import com.google.gson.stream.JsonReader
import java.io.IOException

/**
 * author : Android 轮子哥
 * github : https://github.com/getActivity/EasyHttp
 * time   : 2020/05/05
 * desc   : long / Long 类型解析适配器，参考：[com.google.gson.internal.bind.TypeAdapters.LONG]
 */
class LongTypeAdapter : DoubleTypeAdapter() {
    @Throws(IOException::class)
    override fun read(`in`: JsonReader): Number? {
        val number = super.read(`in`)
        return number?.toLong()
    }
}